<?php
/**
 * Controller de Auditorias.
 *
 *
 * @filesource          
 * @copyright		
 * @link		http://www.pragmatia.com Pragmatia
 * @package		datagro
 * @subpackage	app.controllers
 * @version     1.1
 * @license		http://www.opensource.org/licenses/mit-license.php The MIT License
 * @author      Martin Radosta <mradosta@pragmatia.com>
 */

/**
 * Clase AuditoriasController
 *
 * @package	    datagro
 * @subpackage	app.controllers
 */

class  AuditoriasController extends AppController
{
    var $name = 'Auditorias';

/**
* Constructor.
*
*/


/**
 * Index.
 *
 */
    function index($category_id = null)
    {
		if(!empty($this->data))
		{
			$condicion = $this->Filtro->generarCondicion($this->data['Filtro']);
			$this->paginate['conditions'] = $condicion;
		}
		$this->paginate['order'] = "fecha_hora DESC";
		$this->set('registros', $this->paginate());
		$this->set('usuarios', $this->Auditoria->Usuario->generateList(null, "Usuario.nombre", null, null, "{n}.Usuario.nombre"));
		$this->set('tipos', $this->Auditoria->AuditoriaTipo->generateList(null, null, null, null, "{n}.Dominio.valor"));
    }


/**
 * View.
 *
 */
   function view($id = false) 
   {
        if ($id && is_numeric($id))
        {
            $this->data = $this->Auditoria->read();
        }    
   }  
}
?>
